<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import govDashboard from "./gov";
import entDashboard from "./ent";
import srgDashboard from "./srg";
import expertDashboard from "./expert";
export default {
  name: "Dashboard",
  components: { govDashboard, entDashboard, srgDashboard, expertDashboard },
  data() {
    return {
      currentRole: "",
    };
  },
  computed: {
    ...mapGetters(["account_type"]),
  },
 
  created() {
if (this.account_type == "gov" || this.account_type == "admin") {
      this.currentRole = "govDashboard";
    } else if (this.account_type == "ent") {
      this.currentRole = "entDashboard";
    } else if (this.account_type == "srg") {
      this.currentRole = "srgDashboard";
    } else if (this.account_type == "expert") {
      this.currentRole = "expertDashboard";
    }

  },
};
</script>
